<div xmlns:th="http://www.thymeleaf.org" th:fragment="header" class="fly-header layui-bg-black" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5" >
  <div class="layui-container">
    <a class="fly-logo" href="/">
      <img src="/images/logo.png" alt="rimi">
    </a>
    <ul class="layui-nav fly-nav layui-hide-xs">
      <li class="layui-nav-item layui-this">
        <a href="http://www.rimionline.com"><i class="layui-icon">&#xe68e;</i>官网</a>
      </li>
      <li class="layui-nav-item">
        <a href="http://www.rimionline.com"><i class="layui-icon">&#xe698;</i>商城</a>
      </li>
      <li class="layui-nav-item">
        <a href="http://www.rimionline.com" target="_blank"><i class="layui-icon">&#xe6ed;</i>在线教育</a>
      </li>
    </ul>
    
    <ul class="layui-nav fly-nav-user">
      <!–匿名–>
      <div sec:authorize="isAnonymous()">
        <!-- 未登入的状态 -->
        <li class="layui-nav-item">
          <a class="iconfont icon-touxiang layui-hide-xs" href="/user/login.html"></a>
        </li>
        <li class="layui-nav-item">
          <a href="/user/login.html">登入</a>
        </li>
        <li class="layui-nav-item">
          <a href="/user/reg.html">注册</a>
        </li>
      </div>

      <div sec:authorize="isAuthenticated()">
        <li class="layui-nav-item">
          <a class="fly-nav-avatar" href="javascript:;">
            <cite class="layui-hide-xs" sec:authentication="principal.username">闲心</cite>
            <img class="userImage" th:src="${#authentication.principal.userImage}">
          </a>
          <dl class="layui-nav-child">
            <dd><a th:href="${'/user/username/'+#authentication.principal.username}" href="/user/home.html"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a></dd>
            <dd><a href="/user/set.html"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
            <!--<dd><a href="/user/message.html"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a></dd>-->
            <hr style="margin: 5px 0;">
            <dd><a href="/logout" style="text-align: center;">退出</a></dd>
          </dl>
        </li>
      </div>
    </ul>
  </div>
</div>